/**
 *  macros.h - any useful macros and helper functions to be shared across SOS.
 */

#ifndef SOS_MACROS_H
#define SOS_MACROS_H

/* C99-style bools */
#include <stdbool.h>

#define MIN(a,b)      ((a) > (b) ? (b) : (a))
#define MIN3(a, b, c) (MIN(MIN(a, b), c))
#define MAX(a,b)      ((a) > (b) ? (a) : (b))

/* Integer division, rounded up (rather than truncating) */
#define DIVROUND(a,b) (((a) + ((b) - 1)) / (b))

#endif // SOS_MACROS_H
